#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Native Win32 API Class Library
 * Version 2.00
 * 
 * File Shell Info Class
 *		Provides static methods for extracting file icons and shell information.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"

using namespace System;
using namespace System::Drawing;
using namespace Microsoft::Win32;

namespace Adaptive
{
	namespace Foundation
	{
		namespace IO
		{
			/// <summary>
			/// Provides static methods for extracting file icons and shell information.
			/// </summary>
			public ref class FileShellInfo sealed
			{
			public:
				/*------------------------------------------------------------------------
				 * Public Static Methods / Functions
				 *----------------------------------------------------------------------*/
				#pragma region Public Static Methods / Functions
				/// <summary>
				/// Gets the file type description for the specified file.
				/// </summary>
				/// <param name="fileName">The name of the file for which the information is to
				/// be retrieved.</param>
				/// <returns>
				/// The Windows-registry supplied description of the file.
				/// </returns>
				static String^ GetFileTypeDescription(String^ fileName);
				/// <summary>
				/// Formats the value for display.
				/// </summary>
				/// <param name="originalSize">
				/// The size, in bytes, of a file.
				/// </param>
				/// <returns>
				/// A formatted size string for display purposes.
				/// </returns>
				static String^ FormatFileSize(__int64 originalSize);
				/// <summary>
				/// Gets the application launch string from the registry for the specified 
				/// file.
				/// </summary>
				/// <param name="fileName">
				/// The name of the file for which an application is to be launched.
				/// </param>
				/// <returns>
				/// The application path and name for the application related to the specified
				/// file.
				/// </returns>
				static String^ GetRelatedApplication(String^ fileName);
				/// <summary>
				/// Gets the application launch string from the registry for the specified 
				/// file.
				/// </summary>
				/// <param name="fileName">
				/// The name of the file for which an application is to be launched.
				/// </param>
				/// <returns>
				/// The application path and name for the application related to the specified
				/// file.
				/// </returns>
				static String^ GetRelatedIconStore(String^ fileName);
				/// <summary>
				/// Gets the small icon used for the shell display.
				/// </summary>
				/// <param name="fileName">The name of the file to extract the icon for</param>.
				/// <param name="large">A value indicating whether to extract the large or small icon.</param>
				/// <returns>
				/// An <see cref="Icon"/> instance used for the file type.
				/// </returns>
				static Icon^ GetRelatedIcon(String^ fileName, bool large);
				#pragma endregion

			private:
				/*------------------------------------------------------------------------
				 * Constructor / Dispose / Destructor Methods
				 *----------------------------------------------------------------------*/
				#pragma region Constructor / Dispose / Destructor Methods
				/// <summary>
				/// Initializes a new instance of the class
				/// </summary>
				/// <remarks>
				/// This constructor is hidden to prevent instantiation.
				/// </remarks>
				FileShellInfo();
				#pragma endregion
			};
		}
	}
}